package com.atguigu.controller;

import com.atguigu.pojo.User;
import com.atguigu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: liuaojun
 * @CreateTime: 2025-01-20
 * @Description:
 * @Version: 1.0
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/user")
    public String UserAdd(@RequestBody User user){
        userService.addUser(user);
        return "success";
    }

    @PutMapping("/user")
    public String UserUpdate(@RequestBody User user){
        userService.updateUser(user);
        return "success";
    }
}
